<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html>
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>商铺商品列表</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">

	<link rel="stylesheet" type="text/css" href="res/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="res/css/bootstrap-responsive.min.css">
    <link rel="stylesheet" type="text/css" href="res/css/style.css">
    <script type="text/javascript" src="res/js/jquery-1.9.1.min.js"></script>
    
    
  </head>
  
  <body>
  
    <%@include file="../template/header.jsp" %>
    
    <div class="subHead">
        <div class="container">
            <h1>商家管理后台</h1>
            <p class="lead">商家可以在此修改商品，修改商品类别，添加子店铺账户（总店管理员）等。</p>
        </div>
    </div>
    
    <div class="row mainContent">
        
        <%@include file="../template/shopNav.jsp" %>
        
        <div class="span9">
            <legend class="text-warning">所有商品</legend>
            <table class="table table-striped table-hover">
                <thead>
                <tr>
                    <th>#</th>
                    <th>商品图片</th>
                    <th>商品名称</th>
                    <th>商品价格</th>
                    <th>商品类别</th>
                    <th>修改\删除</th>
                </tr>
                </thead>
                <tbody>
                <s:iterator value="#request.goods" id="g" status="statu">
                	<tr>
	                    <td><s:property value="#statu.index + 1" /></td>
	                    <td><img alt='<s:property value="#g.name"/>' src='<s:property value="#g.minImagePath" />' class="img-rounded" style="width:50px; height: 50px" /></td>
	                    <td><s:property value="#g.name" /></td>
	                    <td><s:property value="#g.price" /></td>
	                    <td>
	                    	<s:iterator value="#g.categories" id="category">
	                    		<s:property value="#category.name" />&nbsp;
	                    	</s:iterator>
	                    </td>
	                    <td>
	                    	<a href="#">修改</a>
	                    	&nbsp&nbsp
	                    	<a name="delete" href="shop/deleteGoods.htm?goodsId=<s:property value='#g.id' />">删除</a>
	                    </td>
	                </tr>
                </s:iterator>
                </tbody>
            </table>
        </div>
    </div>

    <div class="footer">
        <p>版权所有： 银盒子计划团队</p>
    </div>

    <script type="text/javascript" src="../js/bootstrap.min.js"></script>
    <script type="text/javascript">
        $('a[name=delete]').each(function(){
            var that = $(this);
            that.on('click', function(){
                if(confirm('确定删除此商品？')){
                    return;
                }
                else {
                    return false;
                }
            });
        });
        
        $('li[name=templateHeader]').each(function(){
	    	var that = $(this);
	    	that.removeClass("active");
    	});
		$("#templateHeader2").addClass("active");
        
        $('li[name=shopNav]').each(function(){
        	var that = $(this);
        	that.removeClass("active");
        });
        $("#shopNav1").addClass("active");
        
    </script>
  </body>
</html>
